package com.black.cat.jvm;

import java.io.IOException;

/**
 * @Author blackcat
 * @create 2021/8/11 15:12
 * @version: 1.0
 * @description:测试类
 */
public class MainTest {


    public static void main(String[] args){
        long x = fibonacci(10);
        System.out.println(x);
    }

    //斐波那契数列（Fibonacci sequence）
    private static long fibonacci(long n) {
        if (n <= 1) {
            return n;
        } else {
            return fibonacci(n - 1) + fibonacci(n - 2);
        }

    }


}
